<?php
namespace app\api\common;

class ParamsArray {

    /**
     * 微信小程序相关配置参数
     */
    const paramsWxOpenUrl = '';
    const paramsWxAppid = '';
    const paramsWxSecret = '';

    /**
     * 图片路径相关
     */
    const paramsImgUrl = '/shop/public';

    /**
     * 路由参数类列表
     */
    const paramsArr = array(
        'Index' => array(
            'index' => array(),
            'product_page' => array(
                'page'     => 'require|number'
            )
        ),
        'Product' => array(
            'index' => array(
                'pid'      => 'require|number',
                'token' => 'require'
            ),
            'collection' => array(
                'token' => 'require',
                'pid'      => 'require|number'
            )
        ),
        'Shopping' => array(
            'show' => array(
                'token' => 'require'
            ),
            'add' => array(
                'token' => 'require',
                'num'     => 'require|number',
                'pid'     => 'require|number'
            ),
            'delete' => array(
                'token'    => 'require',
                'cart_id'  => 'require|array'
            ),
            'check_shop' => array(
                'token'    => 'require',
                'cart_id'  => 'require|array'
            )
        ),
        'Login' => array(
           'wxlogin' => array(
               'code'  => 'require',
               'name'  => 'require',
               'sex'   => 'require|length:1',
               'photo' => 'require'
           ),
           'register' => array(
                'user_name' => 'require',
                'user_pwd'  => 'require|length:32',
                'code'      => 'require|number|length:6'
            ),
            'login' => array(
                'user_name' => 'require',
                'user_pwd'  => 'require|length:32'
            ),
            'upload_head_img' => array(
                'token'     => 'require'
                /* 头像字段，tp5.0下的request->params(true)获取不到图片，所以第一层校验不校验图片类型，在相应的方法中会校验图片 */
            ),
            'change_pwd'       => array(
                'token'     => 'require',
                'user_ini_pwd' => 'require|length:32',
                'user_pwd'     => 'require|length:32',
            ),
            'set_pwd'  => array(),
            'find_pwd'      => array(
                'user_name' => 'require',
                'user_pwd'  => 'require|length:32',
                'code'      => 'require|number|length:6',
            ),
            'bind_username'  => array(
                'token'    => 'require',
                'user_name'  => 'require',
                'code'       => 'require|number|length:6',
            ),
            'set_nickname' => array(
                'token'        => 'require',
                'user_nickname'  => 'require|chsDash',
            )
        ),
        'MsgCode' => array(
            'get_username_status' => array(
                'user_name' => 'require'
            ),
            'get_code' => array(
                'user_name' => 'require',
                'is_exist' => 'require|number|length:1',
            ),
        ),
        'User' => array(
            'user_info' => array(
                'token' => 'require'
            ),
            'feedback' => array(
                'token' => 'require',
                'con'   => 'require'
            )
        ),
        'Address' => array(
            'get_address'    => array(
                'token'      => 'require'
            ),
            'add_address'    => array(
                'token'      => 'require',
                'name'       => 'require|chsDash',
                'phone'      => 'require|length:11',
                'provence'   => 'require',
                'city'       => 'require',
                'zone'       => 'require',
                'address'    => 'require',
                'code'       => 'require'
            ),
            'del_address'    => array(
                'token'      => 'require',
                'id_arr'     => 'require|array'
            ),
            'get_provence'   => array(),
            'get_city'       => array(
                'provenceid' => 'require|number'
            ),
            'get_zone'       => array(
                'cityid'     => 'require|number'
            ),
            'set_default'    => array(
                'token'      => 'require',
                'addr_id'    => 'require|number'
            )
        ),
        'Category'  => array(
            'top_category'      => array(),
            'second_category'   => array(
                'top_id'        => 'require|number'
            )
        ),
        'Search'    => array(
            'search'      => array()
        ),
        'UploadFile'    => array(
            'check_existence' => array(
                // 'token'      => 'require',
                'fileNames'   => 'require'
            ),
            'upload'         => array(
                // 'token'      => 'require',
                'fileName'   => 'require'
            )
        )
    );
}